<template>
    <page-header-wrapper :title="false">
      <a-card title="设计工作台">
        <a-row :gutter="30">
          <a-col :span="4">
            <a-card hoverable @click="$router.push({ name: 'DesignList' })">
              <a-statistic
                title="今日新增"
                :value="indexData"
                :value-style="{ color: '#3f8600' }"
              >
              </a-statistic>
            </a-card>
          </a-col>
        </a-row>
      </a-card>
    </page-header-wrapper>
</template>

<script>
  import { STable } from '@/components'
  import { getDesignerData } from '@/api/design.process'
  import { getDesignData } from '@/api/dashboard'
  import designColumns from '@/columns/design.process'
  export default {
    name: 'DesignWorkplace',
    components: { STable },
    data () {
      return {
        designerColumns: designColumns.designer,
        designerData: {},
        indexData: {},
        loading: true,
        queryParam: {}
      }
    },
    created () {
      this.getWork()
    },
    methods: {
      getWork () {
        this.loading = true
        getDesignData().then(res => {
          this.indexData = res.result.todayOrders
          this.loading = false
        })
      },
      getDesignerData () {
        const app = this
        app.loading = true
        getDesignerData(app.queryParam).then(res => {
          if (res.status === 0) {
            app.designerData = res.result
            app.loading = false
          } else {
            app.$warning({
              title: res.msg
            })
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
